Many computer graphics systems allow the operator to draw shapes on a screen by using an electronic pen. The pen is moved across the screen or a special tablet by the operator, as if sketching on paper. The position of the pen is repeatedly sensed by the system, and the displayed image is repeatedly updated to show an image of chosen shape at each sensed position. The shape is a cluster of pixels referred to as a brush shape. Some systems allow a choice of brush shape.
The gap, if any, between the brush shape at a newly sensed position and the previously sensed position is filled with a straight line of brush shapes. Thus, a series of short straight line images, known, as line segments, builds up across the screen. If these line segments are sufficiently short, an apparently smooth curve can be produced. The length of the segments depends on the speed at which the pen is moved, and the rate at which the pen position is sensed.
One known method of drawing a straight line segment can be understood by reference to FIGS. 1 and 2. FIG. 1 shows a typical brush shape 10 which is a cluster of twenty-one pixels. This brush shape will appear as a small round spot on a display when viewed from a normal viewing distance.
FIG. 2 shows a line segment 12 formed by a series of brush shapes like the shape 10. The line segment 12 comprises twenty-two spaced, overlapping shapes 10, centred at respective screen positions 14. It can be clearly seen from FIG. 2 that the brush shapes 10 overlap each other to a considerable extent. For instance, two shaded shapes centred on centres 14a and 14b have fourteen pixels in common.
The hardware for generating a graphics display like that of FIG. 2 commonly includes a picture store having a storage element corresponding to each pixel. Data entered in these elements sets the state of the corresponding pixel, such as its colour, brightness etc. The display of FIG. 2 would be built up as follows. The screen position of each centre 14 is determined, and that pixel is set by storing appropriate data in the corresponding storage element. The identity of the other pixels necessary to display a brush shape centred on that pixel are then calculated and these pixels are similarly set. Having generated a complete brush shape centred on one position 14, the process is repeated to generate another brush shape, centred on the next position 14, until the whole line of brush shapes has been generated.
There is a problem associated with this technique. The centres 14 must be closely spaced, in order that the shapes 10 blend to form a smooth line segment 12, but this gives rise to a high degree of overlap of the shapes. The generation of each brush shape entails calculation of the position of 21 pixels and addressing 21 storage elements to set those pixels. Thus, 462 (21 x 22) calculating and addressing operations are carried out to display the line segment 12. However, much of this processing is superfluous because of the overlaps. The line segment 12 only consists of 146 distinct pixels.
It is an object of the present invention to make the generation of line segment displays more efficient, by reducing or eliminating duplication of the operations involved in setting pixels.